<?php


namespace App\Http\Requests\Company;

use Illuminate\Support\Facades\Auth;


class VideoRecordRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:120',

        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入视频标题'),
            'title.max' => __('视频标题的长度不能超过:size个字符', ['size' => 120]),

        ];
    }

    public function filldata()
    {

        $user = Auth::user();
        return [
            'company_id'=>$user['login_company_id'],
            'user_id'=>$user['app_id'],
            'category_id' => (int)$this->input('category_id',0),
            'title' => (string)$this->input('title'),
            'aliyun_video_id'=>(string)$this->input('aliyun_video_id'),
            'duration'=>(string)$this->input('duration'),
            'short_description'=>(string)$this->input('short_description')


        ];
    }

}
